import {
  connect
} from "react-redux"
import UI from './ui'
import {
  addCart,
  jianCart
} from '../../store/actions/index'

export default connect(
  (state) => {
    return {
      products: state.products,
      carts: state.carts
    }
  },
  (dispatch) => {
    return {

      add: (productInfo) => {
        dispatch(addCart(productInfo))
      },
      jian: (productInfo) => {
        dispatch(jianCart(productInfo))
      }
    }
  }
)(UI)